package com.atguigu.product.mq.listener;

import com.atguigu.order.bean.Order;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RocketMQMessageListener(topic = "${good-timeout-topic}", consumerGroup = "${good-timeout-group}")
public class GoodTimeOut implements RocketMQListener<Order> {
    @Override
    public void onMessage(Order order) {
        log.info("用户{} 未支付，自动取消订单 ，订单号：{} ", order.getNickName(), order.getId());
    }
}
